/* ********************************************************************************* */
/* 10 ****************** Institution ownership and COW enactment ******************* */
/* ********************************************************************************* */
/* Summary   : Code combines institution data with firm-year panel                   */
/* ********************************************************************************* */


	LIBNAME cow 'C:\cow';
	LIBNAME data 'C:\data';
	

	* use mvc_all SAS data file as the firm-year panel from SAS program "2 mvc.sas";
	data mvc_data ; set cow.mvc_data ; gvkey1=gvkey*1; drop gvkey; rename gvkey1=gvkey;run;

	* get institutional ownership in cow.controls vars are generated from "control variables.sas" file;
	proc sql; create table inst as select * from mvc_data as a left join cow.controls as b 
	on a.fyenddt=b.fyenddt and a.gvkey=b.gvkey; quit;

	PROC EXPORT DATA= inst OUTFILE= "C:\cow\inst.dta" DBMS=STATA REPLACE;RUN;
